package com.yoga.manager.upyun;


/**
 * Created by chenjin on 17/1/9.
 */
public class Config {

    private static Config config;

    private static Config newconfig;

    // 获取图片的域名
    public  String DOMAIN =null;
    //图片路径
    public   String IMAGE_DIR =null;
    //文件路径
    public   String FILE_DIR = null;
    //服务密钥
    public   String FILE_SECRET = null;
    //操作员配置
    public  String bucket=null;
    public  String username=null;
    public  String password=null;
    /** 密码加密偏移量*/
    static public String user_PASSWORD_ENCRYPT_OFFSET = "123456";

    private Config (String DOMAIN,String IMAGE_DIR,String FILE_DIR,String FILE_SECRET,String bucket,String username,String password,String user_PASSWORD_ENCRYPT_OFFSET){

        this.DOMAIN=DOMAIN;
        this.IMAGE_DIR=IMAGE_DIR;
        this.FILE_DIR=FILE_DIR;
        this.FILE_SECRET=FILE_SECRET;
        this.bucket=bucket;
        this.username=username;
        this.password=password;
       // this.user_PASSWORD_ENCRYPT_OFFSET=user_PASSWORD_ENCRYPT_OFFSET;
    }


    public static Config instance(){
        if (config==null){
            return new Config(
                    "https://image-czt.b0.aicdn.com",
                    "/czt/images",
                    "/czt/file",
                    "czt",
                    "image-czt",
                    "cztadmin",
                    "mpebvM58wHFIiL7C4aKItL7ZiZzDDBsv",
                    user_PASSWORD_ENCRYPT_OFFSET
            );
        }
        return config;

    }

    public static Config getConfig() {
        return config;
    }

    public static void setConfig(Config config) {
        Config.config = config;
    }

    public static Config getNewconfig() {
        return newconfig;
    }

    public static void setNewconfig(Config newconfig) {
        Config.newconfig = newconfig;
    }

    public String getDOMAIN() {
        return DOMAIN;
    }

    public void setDOMAIN(String DOMAIN) {
        this.DOMAIN = DOMAIN;
    }

    public String getIMAGE_DIR() {
        return IMAGE_DIR;
    }

    public void setIMAGE_DIR(String IMAGE_DIR) {
        this.IMAGE_DIR = IMAGE_DIR;
    }

    public String getFILE_DIR() {
        return FILE_DIR;
    }

    public void setFILE_DIR(String FILE_DIR) {
        this.FILE_DIR = FILE_DIR;
    }

    public String getFILE_SECRET() {
        return FILE_SECRET;
    }

    public void setFILE_SECRET(String FILE_SECRET) {
        this.FILE_SECRET = FILE_SECRET;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public static String getUser_PASSWORD_ENCRYPT_OFFSET() {
        return user_PASSWORD_ENCRYPT_OFFSET;
    }

    public static void setUser_PASSWORD_ENCRYPT_OFFSET(String user_PASSWORD_ENCRYPT_OFFSET) {
        Config.user_PASSWORD_ENCRYPT_OFFSET = user_PASSWORD_ENCRYPT_OFFSET;
    }
}
